package com.example.toutiao.ui.main.adpater


import androidx.fragment.app.Fragment
import androidx.fragment.app.FragmentManager
import androidx.fragment.app.FragmentPagerAdapter
import com.example.toutiao.ui.main.model.TabIdsModel

class VideoTabAdapter(fm:FragmentManager, fragments:MutableList<Fragment>, titles:MutableList<TabIdsModel>): FragmentPagerAdapter(fm) {
    private val fragments:MutableList<Fragment>?=fragments
    private val titles:MutableList<TabIdsModel>?=titles
    override fun getCount(): Int =fragments!!.size
    override fun getPageTitle(position: Int): CharSequence? =titles!![position].name
    override fun getItem(position: Int): Fragment = fragments!![position]
}